package com.flyme.module.base.provider.service.impl;

import com.flyme.common.core.model.query.CriteriaQuery;
import com.flyme.common.core.model.query.PagerInfo;
import com.flyme.common.core.model.query.PqGrid;
import com.flyme.common.core.utils.ObjectUtils;
import com.flyme.core.base.supper.entity.EntityMap;
import com.flyme.core.base.supper.service.impl.BaseServiceImpl;
import com.flyme.module.base.client.entity.SysChargeconfig;
import com.flyme.module.base.client.entity.SysInvoice;
import com.flyme.module.base.provider.mapper.SysChargeconfigMapper;
import com.flyme.module.base.provider.mapper.SysInvoiceMapper;
import com.flyme.module.base.provider.service.SysChargeconfigService;
import com.flyme.module.base.provider.service.SysInvoiceService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author: zyf
 * @date: 2018/10/24 16:33
 * @description:
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class SysChargeconfigServiceImpl extends BaseServiceImpl<SysChargeconfigMapper, SysChargeconfig> implements SysChargeconfigService {

    /**
     * 根据类型查询充值配置
     */
    public List<SysChargeconfig> selectByType(Integer type){
        if(ObjectUtils.isEmpty(type)){
            type = 1;
        }
        return list(q().eq("configType", type).orderByAsc("sortOrder"));
    }
}
